<?php 
	include_once 'connect.php';

	$us = $_POST['username'];
	$ps = $_POST['password'];
	$action = $_POST['action'];

	if($action === "check_login_action"){
		$statement = $db->prepare("SELECT * FROM account WHERE username = ? and password = ?");
		$data = array($us,$ps);
		$statement->execute($data);

		$statement->setFetchMode(PDO::FETCH_ASSOC);

		$rows = $statement->rowCount();

		if($rows > 0){
			echo json_encode(array("statusLogin"=>"success"));
		}else{
			echo json_encode(array("statusLogin"=>"fail"));
		}
	}
?>